var a = getApp();

Page({
    data: {
        active: 0,
        avatarInfo: {},
        list: [],
        page: 1
    },
    onLoad: function(a) {
        wx.setNavigationBarTitle({
            title: "代理商奖励"
        }), this.getData();
    },
    goteam: function() {
        wx.navigateTo({
            url: "/packageI/allowanceIndex/allowanceAchievement/allowanceAchievement"
        });
    },
    toUrl: function(a) {
        var t = a.currentTarget.dataset.key;
        wx.navigateTo({
            url: "/packageI/allowanceIndex/allowanceReward/allowanceReward?ind=" + t
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.data.current_page >= this.data.last_page || (this.setData({
            page: this.data.page + 1
        }), this.getmore());
    },
    onShareAppMessage: function() {},
    getData: function() {
        var t = this, e = a.getNetAddresss("plugin.agency-subsidy.frontend.controllers.center.index");
        a._getNetWork({
            url: e,
            data: {
                page: this.data.page
            },
            success: function(e) {
                var n = e.data;
                if (1 != n.result) return a.tips(n.msg);
                t.setData({
                    avatarInfo: n.data.info,
                    list: n.data.list.data,
                    current_page: n.data.current_page,
                    last_page: n.data.last_page
                });
            }
        });
    },
    getmore: function() {
        var t = this, e = a.getNetAddresss("plugin.agency-subsidy.frontend.controllers.center.index");
        a._getNetWork({
            url: e,
            data: {
                page: this.data.page
            },
            success: function(e) {
                var n = e.data;
                if (1 != n.result) return a.tips(n.msg);
                t.setData({
                    list: t.data.list.concat(n.data.list.data),
                    current_page: n.data.current_page,
                    last_page: n.data.last_page
                });
            }
        });
    }
});